<?php

  function mylog($uid,$do,$target){
        $db = new DB();
        $sql = "insert into logs(uid,do,target,time) values('$uid','$do','$target',NOW())";
        $result = $db->insert($sql);
        if($result){
            return json_encode([
                "code"=>200,
                "msg"=>"日志记录成功"
            ]);
        }else{
            return json_encode([
                "code"=>201,
                "msg"=>"日志记录失败" . $result
            ]);
        }
  }
?>